package com.pay.ioopos.activity;

import android.content.Intent;
import android.os.Bundle;

import com.pay.ioopos.KeyInfo;
import com.pay.ioopos.R;
import com.pay.ioopos.fragment.SoundFragment;

import static com.pay.ioopos.KeyInfo.KEY_CANCEL;
import static com.pay.ioopos.KeyInfo.KEY_ENTER;

public class SoundActivity extends AbstractActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sound);
        setMainFragment(new SoundFragment());
    }

    @Override
    public boolean onKeyDown(KeyInfo keyInfo) {
        if (mainFragment instanceof SoundFragment) {
            ((SoundFragment)mainFragment).onKeyDown(keyInfo);
        }
        if (keyInfo == KEY_CANCEL || keyInfo == KEY_ENTER) {
            Intent intent = new Intent(this, SystemActivity.class);
            startActivity(intent);
        }
        return false;
    }

}
